package com.woniuxy.income.service.impl;

import com.woniuxy.core.model.Result;
import com.woniuxy.income.dao.CentifiedIncome;
import com.woniuxy.income.feign.OrderClient;
import com.woniuxy.income.mapper.CentifiedIncomeMapper;
import com.woniuxy.income.service.CentifiedIncomeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 凌玉春
 * @since 2024年01月15日
 */
@Service
public class CentifiedIncomeServiceImpl extends ServiceImpl<CentifiedIncomeMapper, CentifiedIncome> implements CentifiedIncomeService {

    @Autowired
    private CentifiedIncomeMapper centifiedIncomeMapper;
    @Autowired
    private OrderClient orderClient;

    @Override
    public String cerGetTodayInCome(Integer certifiedInfoId) {
        Result<String> bigDecimalResult=orderClient.getTodayIncomeByCerId(certifiedInfoId);
        String bigDecimal = bigDecimalResult.getData();
        return bigDecimal;
    }

    @Override
    public String platGetTodayInCome() {
        Result<String> bigDecimalResult=orderClient.platGetTodayIncome();
        String bigDecimal = bigDecimalResult.getData();
        return bigDecimal;
    }

    @Override
    public String cerGetMonthInCome(Integer certifiedInfoId) {
        Result<String> bigDecimalResult=orderClient.cerGetMonthInCome(certifiedInfoId);
        String bigDecimal = bigDecimalResult.getData();
        return bigDecimal;
    }

}
